/*
 * @Description: 
 * @Author: wangyigang
 * @Date: 2022-11-24 14:32:18
 * @LastEditTime: 2022-11-24 15:25:35
 * @LastEditors: wangyigang
 */
import React, { useEffect } from "react";
import loadable from "@loadable/component";
import WebProgress from "@/components/WebProgress/";

const useLoadingComponent = () => {
  useEffect(() => {
    WebProgress.start();
    return () => {
      WebProgress.done();
    };
  }, []);
  return <div />;
};

export default (Loader, Loading = useLoadingComponent) => {
  return loadable(Loader, {
    fallback: <Loading />
  });
};
